#include <mach/pinctrl.h>
#include <mach/pinctrl_osdep.h>
#include <mach/board_config.h>

#define PAD_NUM             (71)

/* PINCTRL_FUNC */
PINCTRL_FUNC(GPIO30, 0, FUNC0, PUPD_UP, 3);
PINCTRL_FUNC(GPIO31, 1, FUNC0, PUPD_UP, 3);
PINCTRL_FUNC(ETH_LINK_ACT, 1, FUNC1, PUPD_UP, 3);
PINCTRL_FUNC(GPIO32, 2, FUNC0, PUPD_UP, 3);
PINCTRL_FUNC(ETH_LINK_STA, 2, FUNC1, PUPD_UP, 3);
PINCTRL_FUNC(ETH_LINK_SPD, 2, FUNC2, PUPD_UP, 3);
PINCTRL_FUNC(UART0_TX, 3, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO33, 3, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(UART0_RX, 4, FUNC0, PUPD_UP, 3);
PINCTRL_FUNC(GPIO34, 4, FUNC1, PUPD_UP, 3);
PINCTRL_FUNC(I2C0_SCL, 5, FUNC0, PUPD_UP, 2);
PINCTRL_FUNC(GPIO35, 5, FUNC1, PUPD_UP, 2);
PINCTRL_FUNC(I2C0_SDA, 6, FUNC0, PUPD_UP, 2);
PINCTRL_FUNC(GPIO36, 6, FUNC1, PUPD_UP, 2);
PINCTRL_FUNC(SENSOR_CLK, 7, FUNC0, PUPD_NONE, 4);
PINCTRL_FUNC(GPIO12, 7, FUNC1, PUPD_NONE, 2);
PINCTRL_FUNC(GPIO13, 8, FUNC0, PUPD_NONE, 2);
PINCTRL_FUNC(UART1_TX, 9, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO39, 9, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(PWM10, 9, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(SD1_CLK, 9, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(UART1_RX, 10, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO40, 10, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(PWM11, 10, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(SD1_CD, 10, FUNC3, PUPD_UP, 3);
PINCTRL_FUNC(I2C1_SCL, 11, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO37, 11, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(PWM2, 11, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(SD1_CMD_RSP, 11, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(STM_H_0, 11, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(SSI1_CLK, 11, FUNC5, PUPD_NONE, 3);
PINCTRL_FUNC(I2C1_SDA, 12, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO38, 12, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(PWM3, 12, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(SD1_DATA_0, 12, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(STM_H_1, 12, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(SSI1_CSN_0, 12, FUNC5, PUPD_NONE, 3);
PINCTRL_FUNC(UART2_TX, 13, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO41, 13, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(PWM4, 13, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(SD1_DATA_1, 13, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(STM_H_2, 13, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(SSI1_TXD, 13, FUNC5, PUPD_NONE, 3);
PINCTRL_FUNC(UART2_RX, 14, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO42, 14, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(PWM5, 14, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(SD1_DATA_2, 14, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(STM_H_3, 14, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(SSI1_RXD, 14, FUNC5, PUPD_NONE, 3);
PINCTRL_FUNC(USB_PWREN, 15, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO47, 15, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(SD1_DATA_3, 15, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(PWM0, 16, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO43, 16, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(I2C2_SCL, 16, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(UART2_TX, 16, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(PWM1, 17, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO44, 17, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(I2C2_SDA, 17, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(UART2_RX, 17, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO0, 37, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(AC_I2S_DO, 37, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(DW_I2S_DO, 37, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(SSI1_CLK, 37, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(SSI2_CLK, 37, FUNC5, PUPD_NONE, 3);
PINCTRL_FUNC(ACIP_ADDAT, 37, FUNC6, PUPD_NONE, 3);
PINCTRL_FUNC(PWM6, 37, FUNC7, PUPD_NONE, 3);
PINCTRL_FUNC(STM_V_0, 37, FUNC9, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO1, 38, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(AC_I2S_DI, 38, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(DW_I2S_DI, 38, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(SSI1_CSN_0, 38, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(SSI2_CSN_0, 38, FUNC5, PUPD_NONE, 3);
PINCTRL_FUNC(ACIP_DADAT, 38, FUNC6, PUPD_NONE, 3);
PINCTRL_FUNC(PWM7, 38, FUNC7, PUPD_NONE, 3);
PINCTRL_FUNC(STM_V_1, 38, FUNC9, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO2, 39, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(AC_I2S_CLK, 39, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(DW_I2S_CLK, 39, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(SSI1_TXD, 39, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(SSI2_TXD, 39, FUNC5, PUPD_NONE, 3);
PINCTRL_FUNC(ACIP_ADBCLK, 39, FUNC6, PUPD_NONE, 3);
PINCTRL_FUNC(PWM8, 39, FUNC7, PUPD_NONE, 3);
PINCTRL_FUNC(STM_V_2, 39, FUNC9, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO3, 40, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(AC_I2S_WS, 40, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(DW_I2S_WS, 40, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(SSI1_RXD, 40, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(SSI2_RXD, 40, FUNC5, PUPD_NONE, 3);
PINCTRL_FUNC(ACIP_ADLRC, 40, FUNC6, PUPD_NONE, 3);
PINCTRL_FUNC(PWM9, 40, FUNC7, PUPD_NONE, 3);
PINCTRL_FUNC(STM_V_3, 40, FUNC9, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO4, 41, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(AC_MCLK, 41, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(USB_PWREN, 41, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(SD1_CD, 41, FUNC4, PUPD_UP, 3);
PINCTRL_FUNC(SSI0_CLK, 42, FUNC0, PUPD_NONE, 4);
PINCTRL_FUNC(GPIO5, 42, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(SD1_CLK, 42, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(SSI0_CSN_0, 43, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO6, 43, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(SD1_CMD_RSP, 43, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(SSI0_TXD, 44, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO7, 44, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(SD1_DATA_0, 44, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(SSI0_RXD, 45, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO8, 45, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(SD1_DATA_1, 45, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(SSI0_D2, 46, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO9, 46, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(UART1_TX, 46, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(I2C1_SCL, 46, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(SD1_DATA_2, 46, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(SSI0_D3, 47, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO10, 47, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(UART1_RX, 47, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(I2C1_SDA, 47, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(SD1_DATA_3, 47, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(SD0_CD, 52, FUNC0, PUPD_UP, 3);
PINCTRL_FUNC(GPIO17, 52, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(SD0_CLK, 53, FUNC0, PUPD_NONE, 4);
PINCTRL_FUNC(GPIO18, 53, FUNC1, PUPD_NONE, 4);
PINCTRL_FUNC(SSI1_CLK, 53, FUNC2, PUPD_NONE, 4);
PINCTRL_FUNC(SD0_CMD_RSP, 54, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO19, 54, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(SSI1_TXD, 54, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(SD0_DATA_0, 55, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO20, 55, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(SSI1_RXD, 55, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(SD0_DATA_1, 56, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO21, 56, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(SSI1_CSN_0, 56, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(SD0_DATA_2, 57, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO22, 57, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(UART2_TX, 57, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(I2C2_SCL, 57, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(ACIP_DABCLK, 57, FUNC6, PUPD_NONE, 3);
PINCTRL_FUNC(SD0_DATA_3, 58, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO23, 58, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(SSI1_CSN_0, 58, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(UART2_RX, 58, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(I2C2_SDA, 58, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(ACIP_DALRC, 58, FUNC6, PUPD_NONE, 3);
PINCTRL_FUNC(SADC_XAIN0, 59, FUNC0, PUPD_NONE, 2);
PINCTRL_FUNC(GPIO26, 59, FUNC1, PUPD_NONE, 2);
PINCTRL_FUNC(SADC_XAIN1, 60, FUNC0, PUPD_NONE, 2);
PINCTRL_FUNC(GPIO27, 60, FUNC1, PUPD_NONE, 2);
PINCTRL_FUNC(GPIO28, 63, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(ETH_LINK_ACT, 63, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(PWM10, 63, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(SD1_CD, 63, FUNC5, PUPD_UP, 3);
PINCTRL_FUNC(SD1_RSTN, 63, FUNC6, PUPD_NONE, 3);
PINCTRL_FUNC(MAC_MDC, 63, FUNC7, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO29, 64, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(ETH_LINK_STA, 64, FUNC2, PUPD_NONE, 3);
PINCTRL_FUNC(PWM11, 64, FUNC3, PUPD_NONE, 3);
PINCTRL_FUNC(RTC_CLK, 64, FUNC4, PUPD_NONE, 3);
PINCTRL_FUNC(ETH_LINK_SPD, 64, FUNC5, PUPD_NONE, 3);
PINCTRL_FUNC(SD0_RSTN, 64, FUNC6, PUPD_NONE, 3);
PINCTRL_FUNC(MAC_MDIO, 64, FUNC7, PUPD_NONE, 3);
PINCTRL_FUNC(MIPI_CKP, 65, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO13, 65, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(MIPI_CKN, 66, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO28, 66, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(MIPI_DP0, 67, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO29, 67, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(MIPI_DN0, 68, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO30, 68, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(MIPI_DP1, 69, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO31, 69, FUNC1, PUPD_NONE, 3);
PINCTRL_FUNC(MIPI_DN1, 70, FUNC0, PUPD_NONE, 3);
PINCTRL_FUNC(GPIO32, 70, FUNC1, PUPD_NONE, 3);


/* PINCTRL_MUX */

PINCTRL_MUX(AC_I2S_CLK, 0, &PAD39_AC_I2S_CLK);
PINCTRL_MUX(AC_I2S_DI, 0, &PAD38_AC_I2S_DI);
PINCTRL_MUX(AC_I2S_DO, 0, &PAD37_AC_I2S_DO);
PINCTRL_MUX(AC_I2S_WS, 0, &PAD40_AC_I2S_WS);
PINCTRL_MUX(AC_MCLK, 0, &PAD41_AC_MCLK);

PINCTRL_MUX(DW_I2S_CLK, 0, &PAD39_DW_I2S_CLK);
PINCTRL_MUX(DW_I2S_DI, 0, &PAD38_DW_I2S_DI);
PINCTRL_MUX(DW_I2S_DO, 0, &PAD37_DW_I2S_DO);
PINCTRL_MUX(DW_I2S_WS, 0, &PAD40_DW_I2S_WS);

PINCTRL_MUX(ETH_LINK_ACT, 1, &PAD1_ETH_LINK_ACT, &PAD63_ETH_LINK_ACT);
PINCTRL_MUX(ETH_LINK_SPD, 1, &PAD2_ETH_LINK_SPD, &PAD64_ETH_LINK_SPD);
PINCTRL_MUX(ETH_LINK_STA, 1, &PAD2_ETH_LINK_STA, &PAD64_ETH_LINK_STA);

PINCTRL_MUX(I2C0_SCL, 0, &PAD5_I2C0_SCL);
PINCTRL_MUX(I2C0_SDA, 0, &PAD6_I2C0_SDA);

PINCTRL_MUX(I2C1_SCL, 1, &PAD11_I2C1_SCL, &PAD46_I2C1_SCL);
PINCTRL_MUX(I2C1_SDA, 1, &PAD12_I2C1_SDA, &PAD47_I2C1_SDA);

PINCTRL_MUX(I2C2_SCL, 1, &PAD16_I2C2_SCL, &PAD57_I2C2_SCL);
PINCTRL_MUX(I2C2_SDA, 1, &PAD17_I2C2_SDA, &PAD58_I2C2_SDA);

PINCTRL_MUX(MIPI_CKN, 0, &PAD66_MIPI_CKN);
PINCTRL_MUX(MIPI_CKP, 0, &PAD65_MIPI_CKP);
PINCTRL_MUX(MIPI_DN0, 0, &PAD68_MIPI_DN0);
PINCTRL_MUX(MIPI_DN1, 0, &PAD70_MIPI_DN1);
PINCTRL_MUX(MIPI_DP0, 0, &PAD67_MIPI_DP0);
PINCTRL_MUX(MIPI_DP1, 0, &PAD69_MIPI_DP1);

PINCTRL_MUX(PWM0, 0, &PAD16_PWM0);
PINCTRL_MUX(PWM1, 0, &PAD17_PWM1);
PINCTRL_MUX(PWM10, 1, &PAD9_PWM10, &PAD63_PWM10);
PINCTRL_MUX(PWM11, 1, &PAD10_PWM11, &PAD64_PWM11);
PINCTRL_MUX(PWM2, 0, &PAD11_PWM2);
PINCTRL_MUX(PWM3, 0, &PAD12_PWM3);
PINCTRL_MUX(PWM4, 0, &PAD13_PWM4);
PINCTRL_MUX(PWM5, 0, &PAD14_PWM5);
PINCTRL_MUX(PWM6, 0, &PAD37_PWM6);
PINCTRL_MUX(PWM7, 0, &PAD38_PWM7);
PINCTRL_MUX(PWM8, 0, &PAD39_PWM8);
PINCTRL_MUX(PWM9, 0, &PAD40_PWM9);

PINCTRL_MUX(RTC_CLK, 0, &PAD64_RTC_CLK);

PINCTRL_MUX(SADC_XAIN0, 0, &PAD59_SADC_XAIN0);
PINCTRL_MUX(SADC_XAIN1, 0, &PAD60_SADC_XAIN1);

PINCTRL_MUX(SD0_CD, 0, &PAD52_SD0_CD);
PINCTRL_MUX(SD0_CLK, 0, &PAD53_SD0_CLK);
PINCTRL_MUX(SD0_CMD_RSP, 0, &PAD54_SD0_CMD_RSP);
PINCTRL_MUX(SD0_DATA_0, 0, &PAD55_SD0_DATA_0);
PINCTRL_MUX(SD0_DATA_1, 0, &PAD56_SD0_DATA_1);
PINCTRL_MUX(SD0_DATA_2, 0, &PAD57_SD0_DATA_2);
PINCTRL_MUX(SD0_DATA_3, 0, &PAD58_SD0_DATA_3);
PINCTRL_MUX(SD0_RSTN, 0, &PAD64_SD0_RSTN);

PINCTRL_MUX(SD1_CD, 0, &PAD10_SD1_CD, &PAD41_SD1_CD, &PAD63_SD1_CD);
PINCTRL_MUX(SD1_CLK, 0, &PAD9_SD1_CLK, &PAD42_SD1_CLK);
PINCTRL_MUX(SD1_CMD_RSP, 0, &PAD11_SD1_CMD_RSP, &PAD43_SD1_CMD_RSP);
PINCTRL_MUX(SD1_DATA_0, 0, &PAD12_SD1_DATA_0, &PAD44_SD1_DATA_0);
PINCTRL_MUX(SD1_DATA_1, 0, &PAD13_SD1_DATA_1, &PAD45_SD1_DATA_1);
PINCTRL_MUX(SD1_DATA_2, 0, &PAD14_SD1_DATA_2, &PAD46_SD1_DATA_2);
PINCTRL_MUX(SD1_DATA_3, 0, &PAD15_SD1_DATA_3, &PAD47_SD1_DATA_3);
PINCTRL_MUX(SD1_RSTN, 0, &PAD63_SD1_RSTN);

PINCTRL_MUX(SENSOR_CLK, 0, &PAD7_SENSOR_CLK);

PINCTRL_MUX(SSI0_CLK, 0, &PAD42_SSI0_CLK);
PINCTRL_MUX(SSI0_D2, 0, &PAD46_SSI0_D2);
PINCTRL_MUX(SSI0_D3, 0, &PAD47_SSI0_D3);
PINCTRL_MUX(SSI0_RXD, 0, &PAD45_SSI0_RXD);
PINCTRL_MUX(SSI0_TXD, 0, &PAD44_SSI0_TXD);

PINCTRL_MUX(SSI1_CLK, 2, &PAD11_SSI1_CLK, &PAD37_SSI1_CLK, &PAD53_SSI1_CLK);
PINCTRL_MUX(SSI1_RXD, 2, &PAD14_SSI1_RXD, &PAD40_SSI1_RXD, &PAD55_SSI1_RXD);
PINCTRL_MUX(SSI1_TXD, 2, &PAD13_SSI1_TXD, &PAD39_SSI1_TXD, &PAD54_SSI1_TXD);

PINCTRL_MUX(SSI2_CLK, 0, &PAD37_SSI2_CLK);
PINCTRL_MUX(SSI2_CSN_0, 0, &PAD38_SSI2_CSN_0);
PINCTRL_MUX(SSI2_RXD, 0, &PAD40_SSI2_RXD);
PINCTRL_MUX(SSI2_TXD, 0, &PAD39_SSI2_TXD);

PINCTRL_MUX(STM_H_0, 0, &PAD11_STM_H_0);
PINCTRL_MUX(STM_H_1, 0, &PAD12_STM_H_1);
PINCTRL_MUX(STM_H_2, 0, &PAD13_STM_H_2);
PINCTRL_MUX(STM_H_3, 0, &PAD14_STM_H_3);
PINCTRL_MUX(STM_V_0, 0, &PAD37_STM_V_0);
PINCTRL_MUX(STM_V_1, 0, &PAD38_STM_V_1);
PINCTRL_MUX(STM_V_2, 0, &PAD39_STM_V_2);
PINCTRL_MUX(STM_V_3, 0, &PAD40_STM_V_3);

PINCTRL_MUX(UART0_RX, 0, &PAD4_UART0_RX);
PINCTRL_MUX(UART0_TX, 0, &PAD3_UART0_TX);

PINCTRL_MUX(UART1_RX, 0, &PAD10_UART1_RX, &PAD47_UART1_RX);
PINCTRL_MUX(UART1_TX, 0, &PAD9_UART1_TX, &PAD46_UART1_TX);

PINCTRL_MUX(UART2_RX, 0, &PAD14_UART2_RX, &PAD17_UART2_RX, &PAD58_UART2_RX);
PINCTRL_MUX(UART2_TX, 0, &PAD13_UART2_TX, &PAD16_UART2_TX, &PAD57_UART2_TX);

PINCTRL_MUX(GPIO0, 0, &PAD37_GPIO0);
PINCTRL_MUX(GPIO1, 0, &PAD38_GPIO1);
PINCTRL_MUX(GPIO2, 0, &PAD39_GPIO2);
PINCTRL_MUX(GPIO3, 0, &PAD40_GPIO3);
PINCTRL_MUX(GPIO4, 0, &PAD41_GPIO4);
PINCTRL_MUX(GPIO5, 0, &PAD42_GPIO5);
PINCTRL_MUX(GPIO6, 0, &PAD43_GPIO6);
PINCTRL_MUX(GPIO7, 0, &PAD44_GPIO7);
PINCTRL_MUX(GPIO8, 0, &PAD45_GPIO8);
PINCTRL_MUX(GPIO9, 0, &PAD46_GPIO9);
PINCTRL_MUX(GPIO10, 0, &PAD47_GPIO10);
PINCTRL_MUX(GPIO12, 0, &PAD7_GPIO12);
PINCTRL_MUX(GPIO13, 0, &PAD8_GPIO13, &PAD65_GPIO13);
PINCTRL_MUX(GPIO17, 0, &PAD52_GPIO17);
PINCTRL_MUX(GPIO18, 0, &PAD53_GPIO18);
PINCTRL_MUX(GPIO19, 0, &PAD54_GPIO19);
PINCTRL_MUX(GPIO20, 0, &PAD55_GPIO20);
PINCTRL_MUX(GPIO21, 0, &PAD56_GPIO21);
PINCTRL_MUX(GPIO22, 0, &PAD57_GPIO22);
PINCTRL_MUX(GPIO23, 0, &PAD58_GPIO23);
PINCTRL_MUX(GPIO26, 0, &PAD59_GPIO26);
PINCTRL_MUX(GPIO27, 0, &PAD60_GPIO27);
PINCTRL_MUX(GPIO28, 0, &PAD63_GPIO28, &PAD66_GPIO28);
PINCTRL_MUX(GPIO29, 0, &PAD64_GPIO29, &PAD67_GPIO29);
PINCTRL_MUX(GPIO30, 0, &PAD0_GPIO30, &PAD68_GPIO30);
PINCTRL_MUX(GPIO31, 0, &PAD1_GPIO31, &PAD69_GPIO31);
PINCTRL_MUX(GPIO32, 0, &PAD2_GPIO32, &PAD70_GPIO32);
PINCTRL_MUX(GPIO33, 0, &PAD3_GPIO33);
PINCTRL_MUX(GPIO34, 0, &PAD4_GPIO34);
PINCTRL_MUX(GPIO35, 0, &PAD5_GPIO35);
PINCTRL_MUX(GPIO36, 0, &PAD6_GPIO36);
PINCTRL_MUX(GPIO37, 0, &PAD11_GPIO37);
PINCTRL_MUX(GPIO38, 0, &PAD12_GPIO38);
PINCTRL_MUX(GPIO39, 0, &PAD9_GPIO39);
PINCTRL_MUX(GPIO40, 0, &PAD10_GPIO40);
PINCTRL_MUX(GPIO41, 0, &PAD13_GPIO41);
PINCTRL_MUX(GPIO42, 0, &PAD14_GPIO42);
PINCTRL_MUX(GPIO43, 0, &PAD16_GPIO43);
PINCTRL_MUX(GPIO44, 0, &PAD17_GPIO44);
PINCTRL_MUX(GPIO47, 0, &PAD15_GPIO47);

PINCTRL_MUX(SD1_CLK_EMMC, 1, &PAD9_SD1_CLK, &PAD42_SD1_CLK);
PINCTRL_MUX(SD1_CMD_RSP_EMMC, 1, &PAD11_SD1_CMD_RSP, &PAD43_SD1_CMD_RSP);
PINCTRL_MUX(SD1_DATA_0_EMMC, 1, &PAD12_SD1_DATA_0, &PAD44_SD1_DATA_0);
PINCTRL_MUX(SD1_DATA_1_EMMC, 1, &PAD13_SD1_DATA_1, &PAD45_SD1_DATA_1);
PINCTRL_MUX(SD1_DATA_2_EMMC, 1, &PAD14_SD1_DATA_2, &PAD46_SD1_DATA_2);
PINCTRL_MUX(SD1_DATA_3_EMMC, 1, &PAD15_SD1_DATA_3, &PAD47_SD1_DATA_3);

/* PINCTRL_DEVICE */
PINCTRL_DEVICE(ACI2S, 5, &MUX_AC_I2S_CLK, &MUX_AC_I2S_DI, &MUX_AC_I2S_DO,
		&MUX_AC_I2S_WS, &MUX_AC_MCLK);
PINCTRL_DEVICE(AC_MCLK, 1, &MUX_AC_MCLK);
PINCTRL_DEVICE(DWI2S, 4, &MUX_DW_I2S_CLK, &MUX_DW_I2S_DI, &MUX_DW_I2S_DO,
		&MUX_DW_I2S_WS);
PINCTRL_DEVICE(ETH, 2, &MUX_ETH_LINK_ACT, &MUX_ETH_LINK_STA);
PINCTRL_DEVICE(I2C0, 2, &MUX_I2C0_SCL, &MUX_I2C0_SDA);
PINCTRL_DEVICE(I2C1, 2, &MUX_I2C1_SCL, &MUX_I2C1_SDA);
PINCTRL_DEVICE(I2C2, 2, &MUX_I2C2_SCL, &MUX_I2C2_SDA);
PINCTRL_DEVICE(MIPI, 6, &MUX_MIPI_CKN, &MUX_MIPI_CKP, &MUX_MIPI_DN0,
		&MUX_MIPI_DN1, &MUX_MIPI_DP0, &MUX_MIPI_DP1);
PINCTRL_DEVICE(PWM0, 1, &MUX_PWM0);
PINCTRL_DEVICE(PWM1, 1, &MUX_PWM1);
PINCTRL_DEVICE(PWM10, 1, &MUX_PWM10);
PINCTRL_DEVICE(PWM11, 1, &MUX_PWM11);
PINCTRL_DEVICE(PWM2, 1, &MUX_PWM2);
PINCTRL_DEVICE(PWM3, 1, &MUX_PWM3);
PINCTRL_DEVICE(PWM4, 1, &MUX_PWM4);
PINCTRL_DEVICE(PWM5, 1, &MUX_PWM5);
PINCTRL_DEVICE(PWM6, 1, &MUX_PWM6);
PINCTRL_DEVICE(PWM7, 1, &MUX_PWM7);
PINCTRL_DEVICE(PWM8, 1, &MUX_PWM8);
PINCTRL_DEVICE(PWM9, 1, &MUX_PWM9);
PINCTRL_DEVICE(RTC_CLK, 1, &MUX_RTC_CLK);
PINCTRL_DEVICE(SADC_XAIN0, 1, &MUX_SADC_XAIN0);
PINCTRL_DEVICE(SADC_XAIN1, 1, &MUX_SADC_XAIN1);
PINCTRL_DEVICE(SD0, 7, &MUX_SD0_CD, &MUX_SD0_CLK, &MUX_SD0_CMD_RSP,
		&MUX_SD0_DATA_0, &MUX_SD0_DATA_1, &MUX_SD0_DATA_2, &MUX_SD0_DATA_3);
PINCTRL_DEVICE(SD0_1BIT_NO_WP, 4, &MUX_SD0_CD, &MUX_SD0_CLK, &MUX_SD0_CMD_RSP,
		&MUX_SD0_DATA_0);
PINCTRL_DEVICE(SD0_NO_WP, 7, &MUX_SD0_CD, &MUX_SD0_CLK, &MUX_SD0_CMD_RSP,
		&MUX_SD0_DATA_0, &MUX_SD0_DATA_1, &MUX_SD0_DATA_2, &MUX_SD0_DATA_3);
PINCTRL_DEVICE(SD0_WIFI, 6, &MUX_SD0_CLK, &MUX_SD0_CMD_RSP, &MUX_SD0_DATA_0,
		&MUX_SD0_DATA_1, &MUX_SD0_DATA_2, &MUX_SD0_DATA_3);
PINCTRL_DEVICE(SD1, 7, &MUX_SD1_CD, &MUX_SD1_CLK, &MUX_SD1_CMD_RSP,
		&MUX_SD1_DATA_0, &MUX_SD1_DATA_1, &MUX_SD1_DATA_2, &MUX_SD1_DATA_3);
PINCTRL_DEVICE(SD1_1BIT_NO_WP, 4, &MUX_SD1_CD, &MUX_SD1_CLK, &MUX_SD1_CMD_RSP,
		&MUX_SD1_DATA_0);
PINCTRL_DEVICE(SD1_NO_WP, 7, &MUX_SD1_CD, &MUX_SD1_CLK, &MUX_SD1_CMD_RSP,
		&MUX_SD1_DATA_0, &MUX_SD1_DATA_1, &MUX_SD1_DATA_2, &MUX_SD1_DATA_3);
PINCTRL_DEVICE(SD1_WIFI, 6, &MUX_SD1_CLK, &MUX_SD1_CMD_RSP, &MUX_SD1_DATA_0,
		&MUX_SD1_DATA_1, &MUX_SD1_DATA_2, &MUX_SD1_DATA_3);
PINCTRL_DEVICE(SENSOR_CLK, 1, &MUX_SENSOR_CLK);
PINCTRL_DEVICE(SSI0, 4, &MUX_GPIO6, &MUX_SSI0_CLK, &MUX_SSI0_RXD,
		&MUX_SSI0_TXD);
PINCTRL_DEVICE(SSI0_4BIT, 6, &MUX_GPIO6, &MUX_SSI0_CLK, &MUX_SSI0_D2,
		&MUX_SSI0_D3, &MUX_SSI0_RXD, &MUX_SSI0_TXD);
PINCTRL_DEVICE(SSI1, 4, &MUX_GPIO23, &MUX_SSI1_CLK, &MUX_SSI1_RXD,
		&MUX_SSI1_TXD);
PINCTRL_DEVICE(SSI2, 4, &MUX_SSI2_CLK, &MUX_SSI2_CSN_0, &MUX_SSI2_RXD,
		&MUX_SSI2_TXD);
PINCTRL_DEVICE(STM0, 4, &MUX_STM_H_0, &MUX_STM_H_1, &MUX_STM_H_2, &MUX_STM_H_3);
PINCTRL_DEVICE(STM1, 4, &MUX_STM_V_0, &MUX_STM_V_1, &MUX_STM_V_2, &MUX_STM_V_3);
PINCTRL_DEVICE(UART0, 2, &MUX_UART0_RX, &MUX_UART0_TX);
PINCTRL_DEVICE(UART1, 2, &MUX_UART1_RX, &MUX_UART1_TX);
PINCTRL_DEVICE(UART2, 2, &MUX_UART2_RX, &MUX_UART2_TX);
PINCTRL_DEVICE(GPIO0, 1, &MUX_GPIO0);
PINCTRL_DEVICE(GPIO1, 1, &MUX_GPIO1);
PINCTRL_DEVICE(GPIO2, 1, &MUX_GPIO2);
PINCTRL_DEVICE(GPIO3, 1, &MUX_GPIO3);
PINCTRL_DEVICE(GPIO4, 1, &MUX_GPIO4);
PINCTRL_DEVICE(GPIO5, 1, &MUX_GPIO5);
PINCTRL_DEVICE(GPIO6, 1, &MUX_GPIO6);
PINCTRL_DEVICE(GPIO7, 1, &MUX_GPIO7);
PINCTRL_DEVICE(GPIO8, 1, &MUX_GPIO8);
PINCTRL_DEVICE(GPIO9, 1, &MUX_GPIO9);
PINCTRL_DEVICE(GPIO10, 1, &MUX_GPIO10);
PINCTRL_DEVICE(GPIO12, 1, &MUX_GPIO12);
PINCTRL_DEVICE(GPIO13, 1, &MUX_GPIO13);
PINCTRL_DEVICE(GPIO17, 1, &MUX_GPIO17);
PINCTRL_DEVICE(GPIO18, 1, &MUX_GPIO18);
PINCTRL_DEVICE(GPIO19, 1, &MUX_GPIO19);
PINCTRL_DEVICE(GPIO20, 1, &MUX_GPIO20);
PINCTRL_DEVICE(GPIO21, 1, &MUX_GPIO21);
PINCTRL_DEVICE(GPIO22, 1, &MUX_GPIO22);
PINCTRL_DEVICE(GPIO23, 1, &MUX_GPIO23);
PINCTRL_DEVICE(GPIO26, 1, &MUX_GPIO26);
PINCTRL_DEVICE(GPIO27, 1, &MUX_GPIO27);
PINCTRL_DEVICE(GPIO28, 1, &MUX_GPIO28);
PINCTRL_DEVICE(GPIO29, 1, &MUX_GPIO29);
PINCTRL_DEVICE(GPIO30, 1, &MUX_GPIO30);
PINCTRL_DEVICE(GPIO31, 1, &MUX_GPIO31);
PINCTRL_DEVICE(GPIO32, 1, &MUX_GPIO32);
PINCTRL_DEVICE(GPIO33, 1, &MUX_GPIO33);
PINCTRL_DEVICE(GPIO34, 1, &MUX_GPIO34);
PINCTRL_DEVICE(GPIO35, 1, &MUX_GPIO35);
PINCTRL_DEVICE(GPIO36, 1, &MUX_GPIO36);
PINCTRL_DEVICE(GPIO37, 1, &MUX_GPIO37);
PINCTRL_DEVICE(GPIO38, 1, &MUX_GPIO38);
PINCTRL_DEVICE(GPIO39, 1, &MUX_GPIO39);
PINCTRL_DEVICE(GPIO40, 1, &MUX_GPIO40);
PINCTRL_DEVICE(GPIO41, 1, &MUX_GPIO41);
PINCTRL_DEVICE(GPIO42, 1, &MUX_GPIO42);
PINCTRL_DEVICE(GPIO43, 1, &MUX_GPIO43);
PINCTRL_DEVICE(GPIO44, 1, &MUX_GPIO44);
PINCTRL_DEVICE(GPIO47, 1, &MUX_GPIO47);

PINCTRL_DEVICE(SD1_EMMC, 7, &MUX_SD1_CLK_EMMC, &MUX_SD1_CMD_RSP_EMMC,
	&MUX_SD1_DATA_0_EMMC, &MUX_SD1_DATA_1_EMMC, &MUX_SD1_DATA_2_EMMC,
	&MUX_SD1_DATA_3_EMMC, &MUX_SD1_RSTN);

void fh_pinctrl_init_devicelist(OS_LIST *list)
{
	OS_LIST_EMPTY(list);

	/*PINCTRL_ADD_DEVICE*/
	PINCTRL_ADD_DEVICE(ACI2S);
	PINCTRL_ADD_DEVICE(AC_MCLK);
	PINCTRL_ADD_DEVICE(DWI2S);
	PINCTRL_ADD_DEVICE(ETH);
	PINCTRL_ADD_DEVICE(I2C0);
	PINCTRL_ADD_DEVICE(I2C1);
	PINCTRL_ADD_DEVICE(I2C2);
	PINCTRL_ADD_DEVICE(MIPI);
	PINCTRL_ADD_DEVICE(PWM0);
	PINCTRL_ADD_DEVICE(PWM1);
	PINCTRL_ADD_DEVICE(PWM10);
	PINCTRL_ADD_DEVICE(PWM11);
	PINCTRL_ADD_DEVICE(PWM2);
	PINCTRL_ADD_DEVICE(PWM3);
	PINCTRL_ADD_DEVICE(PWM4);
	PINCTRL_ADD_DEVICE(PWM5);
	PINCTRL_ADD_DEVICE(PWM6);
	PINCTRL_ADD_DEVICE(PWM7);
	PINCTRL_ADD_DEVICE(PWM8);
	PINCTRL_ADD_DEVICE(PWM9);
	PINCTRL_ADD_DEVICE(RTC_CLK);
	PINCTRL_ADD_DEVICE(SADC_XAIN0);
	PINCTRL_ADD_DEVICE(SADC_XAIN1);
	PINCTRL_ADD_DEVICE(SD0);
	PINCTRL_ADD_DEVICE(SD0_1BIT_NO_WP);
	PINCTRL_ADD_DEVICE(SD0_NO_WP);
	PINCTRL_ADD_DEVICE(SD0_WIFI);
	PINCTRL_ADD_DEVICE(SD1);
	PINCTRL_ADD_DEVICE(SD1_1BIT_NO_WP);
	PINCTRL_ADD_DEVICE(SD1_NO_WP);
	PINCTRL_ADD_DEVICE(SD1_WIFI);
	PINCTRL_ADD_DEVICE(SENSOR_CLK);
	PINCTRL_ADD_DEVICE(SSI0);
	PINCTRL_ADD_DEVICE(SSI0_4BIT);
	PINCTRL_ADD_DEVICE(SSI1);
	PINCTRL_ADD_DEVICE(SSI2);
	PINCTRL_ADD_DEVICE(STM0);
	PINCTRL_ADD_DEVICE(STM1);
	PINCTRL_ADD_DEVICE(UART0);
	PINCTRL_ADD_DEVICE(UART1);
	PINCTRL_ADD_DEVICE(UART2);
	PINCTRL_ADD_DEVICE(GPIO0);
	PINCTRL_ADD_DEVICE(GPIO1);
	PINCTRL_ADD_DEVICE(GPIO2);
	PINCTRL_ADD_DEVICE(GPIO3);
	PINCTRL_ADD_DEVICE(GPIO4);
	PINCTRL_ADD_DEVICE(GPIO5);
	PINCTRL_ADD_DEVICE(GPIO6);
	PINCTRL_ADD_DEVICE(GPIO7);
	PINCTRL_ADD_DEVICE(GPIO8);
	PINCTRL_ADD_DEVICE(GPIO9);
	PINCTRL_ADD_DEVICE(GPIO10);
	PINCTRL_ADD_DEVICE(GPIO12);
	PINCTRL_ADD_DEVICE(GPIO13);
	PINCTRL_ADD_DEVICE(GPIO17);
	PINCTRL_ADD_DEVICE(GPIO18);
	PINCTRL_ADD_DEVICE(GPIO19);
	PINCTRL_ADD_DEVICE(GPIO20);
	PINCTRL_ADD_DEVICE(GPIO21);
	PINCTRL_ADD_DEVICE(GPIO22);
	PINCTRL_ADD_DEVICE(GPIO23);
	PINCTRL_ADD_DEVICE(GPIO26);
	PINCTRL_ADD_DEVICE(GPIO27);
	PINCTRL_ADD_DEVICE(GPIO28);
	PINCTRL_ADD_DEVICE(GPIO29);
	PINCTRL_ADD_DEVICE(GPIO30);
	PINCTRL_ADD_DEVICE(GPIO31);
	PINCTRL_ADD_DEVICE(GPIO32);
	PINCTRL_ADD_DEVICE(GPIO33);
	PINCTRL_ADD_DEVICE(GPIO34);
	PINCTRL_ADD_DEVICE(GPIO35);
	PINCTRL_ADD_DEVICE(GPIO36);
	PINCTRL_ADD_DEVICE(GPIO37);
	PINCTRL_ADD_DEVICE(GPIO38);
	PINCTRL_ADD_DEVICE(GPIO39);
	PINCTRL_ADD_DEVICE(GPIO40);
	PINCTRL_ADD_DEVICE(GPIO41);
	PINCTRL_ADD_DEVICE(GPIO42);
	PINCTRL_ADD_DEVICE(GPIO43);
	PINCTRL_ADD_DEVICE(GPIO44);
	PINCTRL_ADD_DEVICE(GPIO47);

	PINCTRL_ADD_DEVICE(SD1_EMMC);
}

char* fh_pinctrl_selected_devices[] =
{
	CONFIG_PINCTRL_SELECT
};
